<template>
	<z-paging ref="paging" v-model="list" @query="getList" loading-more-default-text="我也是有底线的哦">
		<view class="mainBg h100 ">
			<navbar title="系列课程">
				<navigator url="/pages/index/search">
					<image src="@/static/index/search.png" mode=""></image>
				</navigator>
			</navbar>
			<view class="list">
				<view class="col">
					<view class="item">
						<image src="@/static/loading.png" mode=""></image>
						<view class="title">
							产品设计从入门到精通
						</view>
						<view class="bottom">
							<view class="price">
								￥58 <text>￥180</text>
							</view>
							<view class="right">
								4888人正在学
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>

	</z-paging>
</template>

<script>
	import item from "./item.vue"
	export default {
		components: {
			item
		},
		data() {
			return {
				list: []
			}
		},
		methods: {
			getList(pageNo, pageSize) {
				this.$post("/course/series_course_list", {
					pageNum: pageNo
				}).then(res => {
					//请勿在网络请求回调中给dataList赋值！！只需要调用complete就可以了
					this.$refs.paging.complete(res.data.rows);
				})
			},

		}
	}
</script>

<style lang="scss">
	page {
		background-color: #35CBAD;
	}

	uni-navigator {
		position: absolute;
		width: 40rpx;
		height: 40rpx;
		right: 40rpx;
		top: 50%;
		transform: translateY(-50%);
	}

	.list .col {
		padding: 10rpx 0;

		.item {
			padding: 20rpx 40rpx;
			background-color: #fff;
			border-radius: 8rpx;

			image {
				height: 280rpx;
				border-radius: 8rpx
			}

			.title {
				font-weight: bold;
				padding: 10rpx 0;
			}

			.bottom {
				display: flex;
				align-items: center;
				justify-content: space-between;
				font-size: 24rpx;
				color: #999;

				.price {
					color: red;
					font-weight: bold;
					font-size: 32rpx;

					text {
						font-size: 24rpx;
						color: #999;
						font-weight: normal;
						text-decoration: line-through;
					}
				}

				.right text {
					font-size: 24rpx;
					padding: 6rpx 10rpx;
					border: 2rpx solid $assist-color2;
					color: $assist-color2;
					border-radius: 100px;
				}
			}
		}
	}
</style>